import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/login.vue'
import Home from '@/views/Home.vue'
import Welcome from '@/views/Welcome.vue'
import users from '@/views/user/User.vue'
import Rights from '@/views/rights/Rights.vue'
import Roles from '@/views/rights/Roles.vue'
import Goods from '@/views/goods/Goods.vue'
import Params from '@/views/goods/Params.vue'
import Categories from '@/views/goods/Categories.vue'
import Orders from '@/views/orders/Orders.vue'
import Reports from '@/views/reports/Reports.vue'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    name: 'default',
    component: Login
  },
  {
    path: '/Login',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    redirect: {name: 'Welcome'},
    children: [{
      path: '/welcome',
      name: 'Welcome',
      component: Welcome
    },
    {
      path: '/users',
      name: 'users',
      component: users
    },
    {
      path: '/roles',
      name: 'roles',
      component: Roles
    },
    {
      path: '/rights',
      name: 'rights',
      component: Rights
    },
    {
      path: '/goods',
      name: 'goods',
      component: Goods
    },
    {
      path: '/params',
      name: 'params',
      component: Params
    },
    {
      path: '/categories',
      name: 'categories',
      component: Categories
    },
    {
      path: '/orders',
      name: 'orders',
      component: Orders
    },
    {
      path: '/reports',
      name: 'reports',
      component: Reports
    }
    ]
  }
  ]
})
